Imports System.Data.OleDb
Imports BUS
Imports DTO
Public Class frmThongKeTheoMatDoSuDung
    Protected Function ConnectionData() As OleDbConnection
        Dim strCn As String
        strCn = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = QLKS.mdb"
        Dim cn As New OleDbConnection(strCn)
        cn.Open()
        Return cn
    End Function
    Public Sub inThongKe()
        Dim cn As OleDbConnection
        cn = Me.ConnectionData()
        Dim path1 As String
        path1 = ""
        Try          
            cryThongKeMatDoSuDungPhong1.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\QLKS.mdb", False)

            cryThongKeMatDoSuDungPhong1.DataSourceConnections.Item(0).SetLogon("admin", "admin")
        Catch exp As Exception
            MsgBox(exp.Message)
        End Try
        Me.CrystalReportViewer1.ReportSource = cryThongKeMatDoSuDungPhong1

    End Sub
    Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load
        inThongKe()
    End Sub
End Class